package me.softwareengineer.guice.rendering.listener;

/**
 * Called to notify about a "word" found in the document. Words are formed by
 * all characters which are not considered as spaces or special symbols.
 * 
 * <pre>
 * Words are formed by the all characters excluding the following ones:
 * 
 *  "\t",    "\n",     "\r",    " ",
 *  "!",     "\"",     "#",     "$",     "%",     "&",     "'",     "(",  
 *  ")",     "*",      "+",     ",",     "-",     ".",     "/",     ":",  
 *  ";",     "<",      "=",     ">",     "?",     "@",     "[",     "\\", 
 *  "]",     "^",      "_",     "`",     "{",     "|",     "}",     "~"
 * </pre>
 * 
 * @author yadtahir
 * @see OnSpaceEvent
 * @see OnSpecialSymbolEvent <pre>
 * This class is thread-safe and immutable.
 * </pre>
 */
public final class OnWordEvent extends Event implements OnElementEvent {
	/**
	 * Holds the word which is wrapped by the WordElement.
	 */
	private String word;

	/**
	 * Sets the word wrapped by the WordElement
	 * 
	 * @param word
	 */
	public OnWordEvent(String word) {
		this.word = word;
	}

	/**
	 * Gets the word wrapped by the WardElement
	 * 
	 * @return
	 */
	public String getWord() {
		return word;
	}
}
